package com.siva.web;

import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.google.common.collect.Lists;
import com.siva.customer.domain.Customer;

@Controller
@RequestMapping(value = "/page")
public class PageCtroller {
    
    static final private List<Customer> customers = Lists.newArrayList(new Customer(1, "siva01", 12), 
            new Customer(2, "siva02", 18), new Customer(3, "siva10", 25));
    
    @RequestMapping(value = "/index")
    public String getCustomerList(ModelMap map) {
        map.addAttribute("name", "sivannnn");
        return "index";
    }
    
    @RequestMapping(value = "/customers")
    public String customers(ModelMap map) {
        map.addAttribute("data", customers);
        return "customers";
    }
}
